﻿@model IEnumerable<Amba.Workflow.Models.WorkflowLogRecord>
@{
    Layout.Title = @T("Event Log");                  
}
<div class="buttonset">

</div>
<table class="items html-blocks-table">
    <thead>
        <tr>
            <th>@T("Date")</th>
            <th>@T("Event")</th>
            <th>@T("Message")</th>
            <th></th>
        </tr>
    </thead>
    @foreach(var logItem in Model)
    {
        <tr>
            <td>
                @(logItem.LogUtcDate.ToString("yyyy.MM.dd hh:mm:ss"))
            </td>
            <td>
                @(logItem.Title)   
            </td>
            <td>
                @(logItem.LogMessage)
            </td>
            <td style="width: 100px;">

                @Html.ActionLink(T("Delete").ToString(), "Delete", new {id = logItem.Id}, new {@class="needs-confirmation"})
            </td>
        </tr>
    } 
</table>
<style type="text/css">
    .buttonset {
        clear: both;
        margin-bottom: 10px;
        height: 25px;
    }

    .buttonset .button {
        float: right;
    }
</style>
@using(Script.Foot())
{
    <script type="text/javascript">
        $().ready(function() {
            $(".needs-confirmation").click(function() {
                if (!window.confirm('@T("Are you sure want to delete this html block?")')) {
                    return false;
                }
                return true;
            });
        });
    </script>
}
